We don't want to have to force people to set it in the environment.
https://bugzilla.gnome.org/show_bug.cgi?id=733734
<literal>https</literal>.</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>proxy</varname></term>
+ <listitem><para>A string value, if given should be a URL for a
+ HTTP proxy to use for access to this repository.</para></listitem>
+ </varlistentry>
+
<varlistentry>
<term><varname>gpg-verify</varname></term>
<listitem><para>A boolean value, defaults to true.
http_proxy = g_getenv ("http_proxy");
if (http_proxy)
{
- SoupURI *proxy_uri = soup_uri_new (http_proxy);
- if (!proxy_uri)
- {
- g_warning ("Invalid proxy URI '%s'", http_proxy);
- }
- else
- {
- g_object_set (self->session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL);
- soup_uri_free (proxy_uri);
- }
+ _ostree_fetcher_set_proxy (self, http_proxy);
}
if (g_getenv ("OSTREE_DEBUG_HTTP"))
return self;
}
+void
+_ostree_fetcher_set_proxy (OstreeFetcher *self,
+ const char *http_proxy)
+{
+ SoupURI *proxy_uri = soup_uri_new (http_proxy);
+ if (!proxy_uri)
+ {
+ g_warning ("Invalid proxy URI '%s'", http_proxy);
+ }
+ else
+ {
+ g_object_set (self->session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL);
+ soup_uri_free (proxy_uri);
+ }
+}
+
void
_ostree_fetcher_set_client_cert (OstreeFetcher *fetcher,
GTlsCertificate *cert)
OstreeFetcher *_ostree_fetcher_new (GFile *tmpdir,
OstreeFetcherConfigFlags flags);
+void _ostree_fetcher_set_proxy (OstreeFetcher *fetcher,
+ const char *proxy);
+
void _ostree_fetcher_set_client_cert (OstreeFetcher *fetcher,
GTlsCertificate *cert);
}
}
+ {
+ gs_free char *http_proxy = NULL;
+
+ if (!ot_keyfile_get_value_with_default (config, remote_key, "proxy",
+ NULL, &http_proxy, error))
+ goto out;
+
+ if (http_proxy)
+ _ostree_fetcher_set_proxy (pull_data->fetcher, http_proxy);
+ }
+
if (!pull_data->base_uri)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,